package com.strange.mdl.module.mdl.controller.admin.dailydharma.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.strange.mdl.framework.excel.core.annotations.DictFormat;
import com.strange.mdl.framework.excel.core.convert.DictConvert;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

import static com.strange.mdl.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static com.strange.mdl.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;

@Schema(description = "管理后台 - 今日弘法 Response VO")
@Data
@ExcelIgnoreUnannotated
public class AppDailydharmaRespVO {

    @Schema(description = "视频唯一ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28183")
    @ExcelProperty("视频唯一ID")
    private Long id;

    @Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("标题")
    private String title;

    @Schema(description = "视频简介", example = "你猜")
    @ExcelProperty("视频简介")
    private String description;

    @Schema(description = "封面链接", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
    @ExcelProperty("封面链接")
    private String coverUrl;

    @Schema(description = "视频链接", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
    @ExcelProperty("视频链接")
    private String videoUrl;

    @Schema(description = "时长，单位秒")
    @ExcelProperty("时长，单位秒")
    private Double duration;

    @Schema(description = "状态: 0-下架, 1-上架", example = "1")
    @ExcelProperty(value = "状态: 0-下架, 1-上架", converter = DictConvert.class)
    @DictFormat("active") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer status;

    @Schema(description = "备注", example = "你猜")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "播放数", example = "0")
    @ExcelProperty("播放数")
    private Integer plays;

    @Schema(description = "创建时间")
    @ExcelProperty("创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private LocalDateTime createTime;



    @Schema(description = "是否点赞")
    private Integer isLike;

    @Schema(description = "是否收藏")
    private Integer isCollect;

    @Schema(description = "是否分享")
    private Integer isShare;

    @Schema(description = "是否评论")
    private Integer isMessage;

    @Schema(description = "点赞数")
    private Integer likes;

    @Schema(description = "收藏数")
    private Integer collects;

    @Schema(description = "分享数")
    private Integer shares;

    @Schema(description = "评论数")
    private Integer messages;

}